package o;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import com.huawei.secure.android.common.intent.SafeIntent;
import java.util.LinkedList;
import java.util.List;

public class cem {
    private final List<SafeIntent> ˏ = new LinkedList();

    public interface e {
        boolean isSameBroadcast(SafeIntent safeIntent, SafeIntent safeIntent2);

        void onReceiveNoRepeat(Context context, SafeIntent safeIntent);
    }

    public void ˋ(@NonNull Context context, @NonNull SafeIntent safeIntent, @NonNull e eVar) {
        ˎ(context, safeIntent, eVar);
    }

    private void ॱ(SafeIntent safeIntent) {
        this.ˏ.add(safeIntent);
    }

    private void ˎ(SafeIntent safeIntent) {
        this.ˏ.remove(safeIntent);
    }

    private boolean ˊ(SafeIntent safeIntent, e eVar) {
        for (SafeIntent isSameBroadcast : this.ˏ) {
            if (eVar.isSameBroadcast(isSameBroadcast, safeIntent)) {
                return true;
            }
        }
        return false;
    }

    private void ˎ(Context context, SafeIntent safeIntent, e eVar) {
        if (!ˊ(safeIntent, eVar)) {
            ॱ(safeIntent);
            eVar.onReceiveNoRepeat(context, safeIntent);
            new Handler(Looper.getMainLooper()).postDelayed(ˏ(safeIntent), 10000);
        }
    }

    private Runnable ˏ(final SafeIntent safeIntent) {
        return new Runnable(this) {
            final /* synthetic */ cem ॱ;

            public void run() {
                this.ॱ.ˎ(safeIntent);
            }
        };
    }
}
